package com.laycoding.kafka.controller;

import com.laycoding.kafka.producer.KafkaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * created with IntelliJ IDEA.
 *
 * @author: guidada
 * @date: 2021/04/18/16:47
 * @description:
 */
@RestController
@RequestMapping("/kafka")
public class KafkaController {

    @Autowired
    private KafkaService kafkaService;

    @RequestMapping("/send")
    public String sendMessage(){

        kafkaService.sendMessage("testTopic","你好Kafka");
        return "ok";
    }

}
